package collection.list;

import java.util.Collections;
import java.util.LinkedList;
import java.util.List;
import java.util.Random;

public class SortInteger {
    public static void main(String[] args) {
        Random random = new Random();
        List<Integer> list = new LinkedList<>();
        for (int i = 0; i <10 ; i++) {
            list.add(random.nextInt(100));
        }
        System.out.println(list);

        Collections.sort(list);
        System.out.println("从小到大排序:"+list);//自然排序
        Collections.reverse(list);
        System.out.println("从大到小排序"+list);

    }
}
